import Vue from 'vue'
import Router from 'vue-router'
import getRoutes from './routes'

Vue.use(Router)

//  前后端记录组件的name值，做权限过滤页面级别路由, 假设请求获得的可用路由数据为authList
const authList: Array<string> = ['home', 'noFound', 'sider']

const routes = getRoutes(authList)

export default new Router({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})
